<template>
  <div class="line-chart-table">
    <div class="title">定额考核</div>
    <div class="left-line-box"></div>
    <div class="chat-box">
      <a-table :dataSource="tableData" :columns="data.columns" :scroll="{  y: 90 }"  :rowClassName="(record, index) => (index % 2 === 1 ? 'table-striped' : null)" />
    </div>
  </div>
</template>

<script setup>
import { useHomeStore } from '@/Store/homeStore';
import { computed, reactive } from 'vue';

const homeStore = useHomeStore();

const tableData = computed(() => {
  return homeStore.quotaAssessmentData;
})

const data = reactive({
  columns: [{
            title: '楼栋名',
            dataIndex: 'title',
            key: 'title',
            align: 'center',
          },
          {
            title: '水定额值',
            dataIndex: 'waterQuotaValue',
            key: 'waterQuotaValue',
            align: 'center',
          },
          {
            title: '电定额值',
            dataIndex: 'electricityRatingValue',
            key: 'electricityRatingValue',
            align: 'center',
          },
          {
            title: '水实际用量',
            dataIndex: 'actualWaterUsage',
            key: 'actualWaterUsage',
            align: 'center',
          },
          {
            title: '电实际用量',
            dataIndex: 'actualElectricityConsumption',
            key: 'actualElectricityConsumption',
            align: 'center',
          },
          {
            title: '考核结果',
            dataIndex: 'result',
            key: 'result',
            align: 'center',
          },],
})
</script>

<style lang="scss" scoped>
.line-chart-table {
  flex: 1;
  max-height: 184px;
  border: 2px solid rgba(35, 135, 217, 1);
  border-top-left-radius: 11px;
  border-bottom-left-radius: 11px;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
  background: linear-gradient(90deg, rgba(33, 100, 156, 0.29) 0%, rgba(29, 70, 143, 0) 100%);
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  box-sizing: border-box;
  position: relative;
  .left-line-box{
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 100%;
    border: 2px solid #2387D9;
    border-top-left-radius: 11px;
    border-bottom-left-radius: 11px;
    border-right: 0;
  }
  &::after {
    content:' ';
    background: linear-gradient(90deg, #2387D9 0%, #051a38 100%);
    position: absolute;
    width: calc(100% - 50px);
    height: 2px;
    left: 50px;
    top: 0px;
  }
  &::before {
    content:' ';
    background: linear-gradient(90deg, #2387D9 0%, #051a38 100%);
    position: absolute;
    width: calc(100% - 50px);
    height: 2px;
    left: 50px;
    bottom: 0px;
  }
  .title{
    width: 28px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0px;
    line-height: 36.2px;
    color: rgba(42, 255, 255, 1);
    text-align: left;
    vertical-align: top;
    margin-top: 9px;
    margin-left: 22px;
  }
  .chat-box{
    flex: 1;
    padding: 19px 0px 19px 63px;
    overflow-y: hidden;
    // height: 100%;

    :deep(.ant-table-wrapper) {
      height: 140px;
    }
    :deep(.ant-table) {
      border-radius: 0px;
      background: transparent;
      .ant-table-thead {
        .ant-table-cell {
          background: rgba(102, 255, 255, 0.2);
          box-sizing: border-box;
          padding: 8px;
          font-size: 16px;
          font-weight: 700;
          letter-spacing: 0px;
          line-height: 21.95px;
          color: rgba(102, 255, 255, 1);
          text-align: center;
          vertical-align: top;
          border: none !important;
          &:before {
            display: none;
          }
        }
      }
      .ant-table-tbody {
        .ant-table-cell{
          border: 0px !important;
          font-size: 14px;
          font-weight: 400;
          letter-spacing: 0px;
          line-height: 19.21px;
          color: rgba(255, 255, 255, 1);
          text-align: left;
          vertical-align: top;
          background: #00000010;
        }
      }
    }
    :deep(.ant-pagination) {
      display: none;
    }
    :deep(.table-striped) td {
        background-color: #66FFFF10 !important;
      }
    :deep(.ant-table-header) {
      border-radius: 0px;
      overflow: hidden;
      table {
        border-radius: 0px;
      }
      .ant-table-thead{
        border-radius: 0px;
        tr {
          :first-child {
            border-radius: 0px;
          }
        }
      }
    }
    :deep(.ant-table-cell-scrollbar) {
      visibility: hidden;
    }
  }
}
</style>